package speed;

public class LogicalOperator {
	public static void main(String[] args) {
		System.out.println("逻辑与：& \n逻辑或：| \n短路与：&& \n短路或：|| \n逻辑异或：^");
		boolean b1=false;
		boolean b2=false;
		boolean b3=true;
		System.out.println("---------------------------------------------------------------------------");
		if (b3!=b1) {
			System.out.println("pass");
		}
		if (b2^b3) {
			System.out.println("fuck off");
		}
		System.out.println("---------------------------------------------------------------------------");
		int i=20;
		if (i<10 && i++>20) {
			System.out.println("pass");
		}else {
			System.out.println("短路与不会继续执行下一指令所以i="+i);
		}
		if (i<10& i++>20) {
			System.out.println("pass");
		}else {
			System.out.println("逻辑与会继续执行下一指令所以i="+i);
		}
		System.out.println("---------------------------------------------------------------------------");
		System.out.println("所以一般都是用短语与或者短路或，这样效率更高。");
	}

}
